$(function() {
	var id_prikey = sessionStorage.getItem("id_prikey")
	var code = sessionStorage.getItem("code")
	if(code == "03") {
		$(".lj").css("display", "none")
	} else if(code=='11'){
		$(".lj").css("display", "none")
		$(".xykhd").css("display","block")
	}else if(code=='12'||code=='14'){
		$(".sbkhd").css("display","none")
		$(".kmhhd").css("display","block")
	}else if(code=="13"){
		$(".sbkhd").css("display","none")
		$(".ckhd").css("display","block")
	}else if(code=='15'){
		$(".sbkhd").css("display","none")
		$(".ckhd").css("display","block")
	}else if(code=='16'){
		$(".sbkhd").css("display","none")
		$(".ckhd").css("display","block")
	}else if(code=='17'){
		$(".ckhd").css("display","block")
	}
	$(".mui-pull-left").click(function() {
		window.location.replace("cx")
	})
	$.post("selectActivityById", {
		"id_prikey": id_prikey
	}, function(data) {
	/*	alert(JSON.stringify(data))*/
		var rel = data.data;
		$(".name").text(rel.姓名)
		$(".tel").text(add(rel.手机号))
		if(code=='15'){
			$(".sfzh").text(add(rel.账号1))
		}else{
			$(".sfzh").text(add(rel.身份证号))
		}
		
		$(".hdmc").text(rel.活动名称)
		$(".djr").text(rel.登记人)
		$(".djsj").text(rel.登记时间)
		$(".ckje").text(add(rel.金额1+'万元'))
		$(".ckjf").text(rel.抽奖券序号)
		$(".jp").text(rel.奖品名称)
		$(".cjkh").text(rel.凭证号)
		$(".xyk").text(rel.账号1)
		$(".zh").text(add(rel.账号1))
		$(".shdz").text(add(rel.客户地址))
		$(".blyw").text(add(rel.业务名称))
		$(".yxr").text(add(rel.营销人名称))
	})
})
//获取办卡类型
function hdtype(code) {
	$.post("selectBusinessByactivityType", {
		"activityType": "01"
	}, function(data) {
		if(data.length > 0) {
			for(var i in data) {
				if(data[i].业务ID == code) {
					$(".blyw").text(data[i].业务名称)

				}
			}

		}
	})
}
//获取办理网点
function hb_wd(a) {
	$.post("selectDeptByActivity", {
		"activityType": "01"
	}, function(data) {
		if(data.ok) {
			var rel = data.ok
			for(var i in rel) {
				if(rel[i].deptId == a) {
					$(".blwd").text(rel[i].name)

				}
			}
		} else {

		}
	})
}
function add(row){
		
		if(row==undefined||row=='null'){
			return ""
		}else{
			return row
		}
	}
function abb(a) {
	if(a == "1900-01-01") {
		return ""
	} else {
		return a
	}
}